package com.msmall.community.bbs.dao.hibernate;

import java.util.List;

import com.msmall.base.dao.hibernate.BaseDaoHibernate;
import com.msmall.community.bbs.dao.BoardDao;
import com.msmall.community.bbs.model.Board;
import com.msmall.community.bbs.model.BoardKeyword;

public class BoardDaoHibernate extends BaseDaoHibernate<Board, Long> implements BoardDao{

	public BoardDaoHibernate(){
		super(Board.class);
	}
	
	/**
	 * 通过boardid获得此版权下的所有关键字，orders 1,2,3
	 */
	public List<BoardKeyword> getKeywordsByBoardid(Long boardid) throws Exception{
		try{
			String queryString = " FROM BoardKeyword where boardid=? ORDER BY orders ASC";
			return getHibernateTemplate().find(queryString, new Object[]{boardid});
		}catch(Exception e){
			throw e;
		}
	}
}
